home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Reusable Classes_Code / REALfishSource / schneier folder / blowfish.doc < prev   
Encoding:
Text File  |  2000-09-05  |  29.5 KB  |  675 lines

  1.  Description of a New Variable-Length Key, 64-Bit Block Cipher    
  2.                            (Blowfish)
  3.  
  4.                           Bruce Schneier
  5.    Counterpane Systems, 730 Fair Oaks Ave, Oak Park, IL  60302
  6.                         schneier@chinet.com
  7.  
  8.  
  9.                             Abstract:
  10.  
  11. Blowfish, a new secret-key block cipher, is proposed.  It is a
  12. Feistel network, iterating a simple encryption function 16 times. 
  13. The block size is 64 bits, and the key can be any length up to
  14. 448 bits.  Although there is a complex initialization phase
  15. required before any encryption can take place, the actual
  16. encryption of data is very efficient on large microprocessors.
  17.  
  18.  
  19.  
  20. The cryptographic community needs to provide the world with a new
  21. encryption standard.  DES [16], the workhorse encryption
  22. algorithm for the past fifteen years, is nearing the end of its
  23. useful life.  Its 56-bit key size is vulnerable to a brute-force
  24. attack [22], and recent advances in differential cryptanalysis
  25. [1] and linear cryptanalysis [10] indicate that DES is vulnerable
  26. to other attacks as well.
  27.  
  28. Many of the other unbroken algorithms in the literature˛Khufu
  29. [11,12], REDOC II [2,23, 20], and IDEA [7,8,9]˛are protected by
  30. patents.  RC2 and RC4, approved for export with a small key size,
  31. are proprietary [18].  GOST [6], a Soviet government algorithm,
  32. is specified without the S-boxes.  The U.S. government is moving
  33. towards secret algorithms, such as the Skipjack algorithm in the
  34. Clipper and Capstone chips [17].
  35.  
  36. If the world is to have a secure, unpatented, and freely-
  37. available encryption algorithm by the turn of the century, we
  38. need to develop several candidate encryption algorithms now. 
  39. These algorithms can then be subjected to years of public
  40. scrutiny and cryptanalysis.  Then, the hope is that one or more
  41. candidate algorithms will survive this process, and can
  42. eventually become a new standard.
  43.  
  44. This paper discusses the requirements for a standard encryption
  45. algorithm.  While it may not be possible to satisfy all
  46. requirements with a single algorithm, it may be possible to
  47. satisfy them with a family of algorithms based on the same
  48. cryptographic principles.
  49.  
  50. AREAS OF APPLICATION
  51.  
  52. A standard encryption algorithm must be suitable for many
  53. different applications:
  54.  
  55.          Bulk encryption.  The algorithm should be efficient in
  56.                  encrypting data files or a continuous data stream.
  57.  
  58.          Random bit generation.  The algorithm should be efficient in
  59.                  producing single random bits.
  60.  
  61.          Packet encryption.  The algorithm should be efficient in
  62.                  encrypting packet-sized data.  (An ATM packet has a 48-
  63.                  byte data field.)  It should implementable in an
  64.                  application where successive packets may be encrypted
  65.                  or decrypted with different keys.
  66.  
  67.          Hashing.  The algorithm should be efficient in being
  68.                  converted to a one-way hash function.
  69.  
  70. PLATFORMS
  71.  
  72. A standard encryption algorithm must be implementable on a
  73. variety of different platforms, each with their own requirements. 
  74. These include:
  75.  
  76.          Special hardware.  The algorithm should be efficiently
  77.                  implementable in custom VLSI hardware.
  78.  
  79.          Large processors.  While dedicated hardware will always be
  80.                  used for the fastest applications, software
  81.                  implementations are more common.  The algorithm should
  82.                  be efficient on 32-bit microprocessors with 4 kbyte
  83.                  program and data caches.
  84.  
  85.          Medium-size processors.  The algorithm should run on
  86.                  microcontrollers and other medium-size processors, such
  87.                  as the 68HC11.
  88.  
  89.          Small processors.  It should be possible to implement the
  90.          algorithm on smart cards, even inefficiently.
  91.  
  92. The requirements for small processors are the most difficult. 
  93. RAM and ROM limitations are severe for this platform.  Also,
  94. efficiency is more important on these small machines. 
  95. Workstations double their capacity almost annually.  Small
  96. embedded systems are the same year after year, and there is
  97. little capacity to spare.  If there is a choice, the extra
  98. computation burden should be on large processors rather than
  99. small processors.
  100.  
  101. ADDITIONAL REQUIREMENTS
  102.  
  103. These additional requirements should, if possible, be levied on a
  104. standard encryption algorithm.
  105.  
  106.          The algorithm should be simple to code.  Experiences with
  107.          DES [19] show that programmers will often make
  108.          implementation mistakes if the algorithm is complicated.  If
  109.          possible, the algorithm should be robust against these
  110.          mistakes.
  111.  
  112.          The algorithm should have a flat keyspace, allowing any
  113.          random bit string of the required length to be a possible
  114.          key.  There should be no weak keys.
  115.  
  116.          The algorithm should facilitate easy key-management for
  117.          software implementations.  Software implementations of DES
  118.          generally use poor key management techniques.  In
  119.          particular, the password that the user types in becomes the
  120.          key.  This means that although DES has a theoretical
  121.          keyspace of 256, the actual keyspace is limited to keys
  122.          constructed with the 95 characters of printable ASCII. 
  123.          Additionally, keys corresponding to words and near words are
  124.          much more likely.
  125.  
  126.          The algorithm should be easily modifiable for different
  127.          levels of security, both minimum and maximum requirements.
  128.  
  129.          All operations should manipulate data in byte-sized blocks. 
  130.          Where possible, operations should manipulate data in 32-bit
  131.          blocks.
  132.  
  133. DESIGN DECISIONS
  134.  
  135. Based on the above parameters, we have made these design
  136. decisions.  The algorithm should:
  137.  
  138.          Manipulate data in large blocks, preferably 32 bits in size
  139.          (and not in single bits, such as DES).
  140.  
  141.          Have either a 64-bit or a 128-bit block size.
  142.  
  143.          Have a scalable key, from 32 bits to at least 256 bits.
  144.  
  145.          Use simple operations that are efficient on microprocessors: 
  146.          e.g., exclusive-or, addition, table lookup, modular-
  147.          multiplication.  It should not use variable-length shifts or
  148.          bit-wise permutations, or conditional jumps.
  149.  
  150.          Be implementable on an 8-bit processor with a minimum of 24
  151.          bytes of RAM (in addition to the RAM required to store the
  152.          key) and 1 kilobyte of ROM.
  153.  
  154.          Employ precomputable subkeys.  On large-memory systems,
  155.          these subkeys can be precomputed for faster operation.  Not
  156.          precomputing the subkeys will result in slower operation,
  157.          but it should still be possible to encrypt data without any
  158.          precomputations.
  159.  
  160.          Consist of a variable number of iterations.  For
  161.          applications with a small key size, the trade-off between
  162.          the complexity of a brute-force attack and a differential
  163.          attack make a large number of iterations superfluous. 
  164.          Hence, it should be possible to reduce the number of
  165.          iterations with no loss of security (beyond that of the
  166.          reduced key size).
  167.  
  168.          If possible, have no weak keys.  If not possible, the
  169.          proportion of weak keys should be small enough to make it
  170.          unlikely to choose one at random.  Also, any weak keys
  171.          should be explicitly known so they can be weeded out during
  172.          the key generation process.
  173.  
  174.          Use subkeys that are a one-way hash of the key.  This would
  175.          allow the use of long passphrases for the key without
  176.          compromising security.
  177.  
  178.          Have no linear structures (e.g., the complementation
  179.          propertie of DES) that reduce the complexity of exhaustive
  180.          search [4].
  181.  
  182.          Use a design that is simple to understand.  This will
  183.          facilitate analysis and increase the confidence in the
  184.          algorithm.  In practice, this means that the algorithm will
  185.          be a Feistel iterated block cipher [21].
  186.  
  187. Most of these design decisions are not new.  Almost all block
  188. ciphers since Lucifer [5,21] are Feistel ciphers, and all have a
  189. flat keyspace (with the possible exception of a few weak keys). 
  190. FEAL [13,14,15] and Khufu [11] use a variable number of
  191. iterations.  Khufu [11] has a large number of subkeys that are a
  192. one-way function of the key.  RC2 [18] has a variable-length key. 
  193. GOST [6] uses a 32-bit word length and a 64-bit block size.  MMB
  194. [2] uses a 32-bit word length and a 128-bit block size.
  195.  
  196. BUILDING BLOCKS
  197.  
  198. There are a number of building blocks that have been demonstrated
  199. to produce strong ciphers.  Many of these can be efficiently
  200. implemented on 32-bit microprocessors.
  201.  
  202.          Large S-boxes.  Larger S-boxes are more resistant to
  203.          differential cryptanalysis.  An algorithm with a 32-bit word
  204.          length can use 32-bit S-boxes.  Khufu and REDOC III both use
  205.          a 256-entry, 32-bit wide S-box [11,20].
  206.  
  207.          Key-dependent S-boxes.  While fixed S-boxes must be designed
  208.          to be resistant to differential and linear cryptanalysis,
  209.          key-dependent S-boxes are much more resistant to these
  210.          attacks.  They are used in the Khufu algorithm [11]. 
  211.          Variable S-boxes, which could possibly be key dependent, are
  212.          used in GOST [6].
  213.  
  214.          Combining operations from different algebraic groups.  The
  215.          IDEA cipher introduced this concept, combining XOR mod 216,
  216.          addition mod 216, and multiplication mod 216+1 [7].  The MMB
  217.          cipher uses a 32-bit word, and combines XOR mod 232 with
  218.          multiplication mod 232-1 [2].
  219.  
  220.          Key-dependent permutations.  The fixed initial and final
  221.          permutations of DES have been long regarded as
  222.          cryptographically worthless.  Khufu XORs the text block with
  223.          key material at the beginning and the end of the algorithm
  224.          [11].
  225.  
  226. BLOWFISH
  227.  
  228. Blowfish is a variable-length key block cipher.  It does not meet
  229. all the requirements for a new cryptographic standard discussed
  230. above: it is only suitable for applications where the key does
  231. not change often, like a communications link or an automatic file
  232. encryptor.  It is significantly faster than DES when implemented
  233. on 32-bit microprocessors with large data caches, such as the
  234. Pentium and the PowerPC.
  235.  
  236. DESCRIPTION OF THE ALGORITHM
  237.  
  238. Blowfish is a variable-length key, 64-bit block cipher.  The
  239. algorithm consists of two parts: a key-expansion part and a data-
  240. encryption part.  Key expansion converts a key of at most 448
  241. bits into several subkey arrays totaling 4168 bytes. 
  242.  
  243. Data encryption occurs via a 16-round Feistel network.  Each
  244. round consists of a key-dependent permutation, and a key- and
  245. data-dependent substitution.  All operations are XORs and
  246. additions on 32-bit words.  The only additional operations are
  247. four indexed array data lookups per round.
  248.  
  249. Subkeys:
  250.  
  251. Blowfish uses a large number of subkeys.  These keys must be
  252. precomputed before any data encryption or decryption.
  253.  
  254.          1.  The P-array consists of 18 32-bit subkeys:
  255.                  P1, P2,..., P18.
  256.  
  257.          2.  There are four 32-bit S-boxes with 256 entries each:
  258.                  S1,0, S1,1,..., S1,255; 
  259.                  S2,0, S2,1,..,, S2,255;
  260.                  S3,0, S3,1,..., S3,255;
  261.                  S4,0, S4,1,..,, S4,255.
  262.  
  263. The exact method used to calculate these subkeys will be
  264. described later.
  265.  
  266. Encryption:
  267.  
  268. Blowfish is a Feistel network consisting of 16 rounds (see Figure
  269. 1).  The input is a 64-bit data element, x.
  270.  
  271.          Divide x into two 32-bit halves:  xL, xR
  272.          For i = 1 to 16:
  273.                  xL = xL XOR Pi
  274.                  xR = F(xL) XOR xR
  275.                  Swap xL and xR
  276.          Swap xL and xR  (Undo the last swap.)
  277.          xR = xR XOR P17
  278.          xL = xL XOR P18
  279.          Recombine xL and xR
  280.  
  281.          Function F (see Figure 2):
  282.                  Divide xL into four eight-bit quarters:  a, b, c, and d
  283.                  F(xL) = ((S1,a + S2,b mod 232) XOR S3,c) + S4,d mod 232
  284.  
  285. Decryption is exactly the same as encryption, except that P1,
  286. P2,..., P18 are used in the reverse order.
  287.  
  288. Implementations of Blowfish that require the fastest speeds
  289. should unroll the loop and ensure that all subkeys are stored in
  290. cache.
  291.  
  292. Generating the Subkeys:
  293.  
  294. The subkeys are calculated using the Blowfish algorithm.  The
  295. exact method is as follows:
  296.  
  297.          1.  Initialize first the P-array and then the four S-boxes,
  298.          in order, with a fixed string.  This string consists of the
  299.          hexadecimal digits of pi (less the initial 3).  For example:
  300.  
  301.                  P1 = 0x243f6a88
  302.                  P2 = 0x85a308d3 
  303.                  P3 = 0x13198a2e
  304.                  P4 = 0x03707344 
  305.  
  306.          2.  XOR P1 with the first 32 bits of the key, XOR P2 with the
  307.          second 32-bits of the key, and so on for all bits of the key
  308.          (possibly up to P14).  Repeatedly cycle through the key bits
  309.          until the entire P-array has been XORed with key bits.  (For
  310.          every short key, there is at least one equivalent longer
  311.          key; for example, if A is a 64-bit key, then AA, AAA, etc.,
  312.          are equivalent keys.)
  313.  
  314.          3.  Encrypt the all-zero string with the Blowfish algorithm,
  315.          using the subkeys described in steps (1) and (2).
  316.  
  317.          4.  Replace P1 and P2 with the output of step (3).
  318.  
  319.          5.  Encrypt the output of step (3) using the Blowfish
  320.          algorithm with the modified subkeys.
  321.  
  322.          6.  Replace P3 and P4 with the output of step (5).
  323.  
  324.          7.  Continue the process, replacing all entries of the P-
  325.          array, and then all four S-boxes in order, with the output
  326.          of the continuously-changing Blowfish algorithm.
  327.  
  328. In total, 521 iterations are required to generate all required
  329. subkeys.  Applications can store the subkeys rather than execute
  330. this derivation process multiple times.
  331.  
  332. MINI-BLOWFISH
  333.  
  334. The following mini versions of Blowfish are defined solely for
  335. cryptanalysis.  They are not suggested for actual implementation. 
  336. Blowfish-32 has a 32-bit block size and subkey arrays of 16-bit
  337. entries (each S-box has 16 entries).  Blowfish-16 has a 16-bit
  338. block size and subkey arrays of 8-bit entries (each S-box has 4
  339. entries).
  340.  
  341. DESIGN DECISIONS
  342.  
  343. The underlying philosophy behind Blowfish is that simplicity of
  344. design yields an algorithm that is both easier to understand and
  345. easier to implement.  Through the use of a streamlined Feistel
  346. network˛a simple S-box substitution and a simple P-box
  347. substitution˛I hope that the design will not contain any flaws.
  348.  
  349. A 64-bit block size yields a 32-bit word size, and maintains
  350. block-size compatibility with existing algorithms.  Blowfish is
  351. easy to scale up to a 128-bit block, and down to smaller block
  352. sizes.  Cryptanalysis of the mini-Blowfish variants may be
  353. significantly easier than cryptanalysis of the full version.
  354.  
  355. The fundamental operations were chosen with speed in mind.  XOR,
  356. ADD, and MOV from a cache are efficient on both Intel and
  357. Motorola architectures.  All subkeys fit in the cache of a 80486,
  358. 68040, Pentium, and PowerPC.
  359.  
  360. The Feistel network that makes up the body of Blowfish is
  361. designed to be as simple as possible, while still retaining the
  362. desirable cryptographic properties of the structure.  Figure 3 is
  363. round i of a general Feistel network:  Rn,i are reversible
  364. functions of text and key, and Ni is a non-reversible function of
  365. text and key.  For speed and simplicity, I chose XOR as my
  366. reversible function.  This let me collapse the four XORs into a
  367. single XOR, since:
  368.  
  369.          R˛1,i+1 = R1,i+1 XOR R2,i-1 XOR R3,i XOR R4,i
  370.  
  371. This is the P-array substitution in Blowfish.  The XOR can also
  372. be considered to be part of the non-reversible function, Ni,
  373. occurring at the end of the function.  (Although equivalent, I
  374. chose not to illustrate them in this way because it simplifies
  375. description of the subkey-generation process.)  There are two
  376. XORs that remain after this reduction: R1 in the first round and
  377. R2 in the last round.  I chose not to eliminate these in order to
  378. hide the input to the first non-reversible function.
  379.  
  380. I considered a more complicated reversible function, one with
  381. modular multiplications and rotations.  However, these operations
  382. would greatly increase the algorithm's execution time.  Since
  383. function F is the primary source of the algorithm's security, I
  384. decided to save time-consuming complications for that function.
  385.  
  386. Function F, the non-reversible function, gives Blowfish the best
  387. possible avalanche effect for a Feistel network:  every text bit
  388. on the left half of the round affects every text bit on the right
  389. half.  Additionally, since every subkey bit is affected by every
  390. key bit, the function also has a perfect avalanche effect between
  391. the key and the right half of the text after every round.  Hence,
  392. the algorithm exhibits a perfect avalanche effect after three
  393. rounds and again every two rounds after that.
  394.  
  395. I considered adding a reversible mixing function, more
  396. complicated than XOR, before the first and after the last round. 
  397. This would further confuse the entry values into the Feistel
  398. network and ensure a complete avalanche effect after the first
  399. two rounds.  I eventually discarded the addition as a time-
  400. consuming complication with no clear cryptographic benefits.
  401.  
  402. The non-reversible function is designed for strength, speed, and
  403. simplicity.  Ideally, I wanted a single S-box with 232 32-bit
  404. words, but that was impractical.  My eventual choice of 256-entry
  405. S-boxes was a compromise between my three design goals.  The
  406. small-number of bits to large-number of bits may have weaknesses
  407. with respect to linear cryptanalysis, but these weaknesses are
  408. hidden both by combining the output of four S-boxes and making
  409. them dependent on the key.
  410.  
  411. I used four different S-boxes instead of one S-box primarily to
  412. avoid symmetries when different bytes of the input are equal, or
  413. when the 32-bit input to function F is a bytewise permutation of
  414. another 32-bit input.  I could have used one S-box and made each
  415. of the four different outputs a non-trivial permutation of the
  416. single output, but the four S-box design is faster, easier to
  417. program, and seems more secure.
  418.  
  419. The function that combines the four S-box outputs is as fast as
  420. possible.  A simpler function would be to XOR the four values,
  421. but mixing addition mod 232 and XOR combines two different
  422. algebraic groups with no additional instructions.  The
  423. alternation of addition and XOR ends with an addition operation
  424. because an XOR combines the final result with xR.
  425.  
  426. If the four indexes chose values out of the same S-box, a more
  427. complex combining function would be required to eliminate
  428. symmetries.  I considered using a more complex combining function
  429. in Blowfish (using modular multiplications, rotations, etc.), but
  430. chose not to because the added complication seemed unnecessary.
  431.  
  432. The key-dependent S-boxes protect against differential and linear
  433. cryptanalysis.  Since the structure of the S-boxes is completely
  434. hidden from the cryptanalyst, these attacks have a more difficult
  435. time exploiting that structure.  While it would be possible to
  436. replace these variable S-boxes with four fixed S-boxes that were
  437. designed to be resistant to these attacks, key-dependent S-boxes
  438. are easier to implement and less susceptible to arguments of
  439. "hidden" properties.  Additionally, these S-boxes can be created
  440. on demand, reducing the need for large data structures stored
  441. with the algorithm.
  442.  
  443. Each bit of xL is only used as the input to one S-box.  In DES
  444. many bits are used as inputs to two S-boxes, which strengthens
  445. the algorithm considerably against differential attacks.  I feel
  446. that this added complication is not as necessary with key-
  447. dependent S-boxes.  Additionally, larger S-boxes would take up
  448. considerably more memory space.
  449.  
  450. Function F does not depend on the iteration.  I considered adding
  451. this dependency, but did not feel that it had any cryptographic
  452. merit.  The P-array substitution can be considered to be part of
  453. this function, and that is already iteration-dependent.
  454.  
  455. The number of rounds is set at 16 primarily out of desire to be
  456. conservative.  However, this number affects the size of the P-
  457. array and therefore the subkey-generation process; 16 iterations
  458. permits key lengths up to 448 bits.  I expect to be able to
  459. reduce this number, and greatly speed up the algorithm in the
  460. process, as I accumulate more cryptanalysis data.
  461.  
  462. In algorithm design, there are two basic ways to ensure that the
  463. key is long enough to ensure a particular security level.  One is
  464. to carefully design the algorithm so that the entire entropy of
  465. the key is preserved, so there is no better way to cryptanalyze
  466. the algorithm other than brute force.  The other is to design the
  467. algorithm with so many key bits that attacks that reduce the
  468. effective key length by several bits are irrelevant.  Since
  469. Blowfish is designed for large microprocessors with large amounts
  470. of memory, I chose the latter.
  471.  
  472. The subkey generation process is designed to preserve the entire
  473. entropy of the key and to distribute that entropy uniformly
  474. throughout the subkeys.  It is also designed to distribute the
  475. set of allowed subkeys randomly throughout the domain of possible
  476. subkeys.  I chose the digits of pi as the initial subkey table
  477. for two reasons: because it is a random sequence not related to
  478. the algorithm, and because it could either be stored as part of
  479. the algorithm or derived when needed.  There is nothing sacred
  480. about pi; any string of random bits˛digits of e, RAND tables,
  481. output of a random number generator˛will suffice.  However, if
  482. the initial string is non-random in any way (for example, ASCII
  483. text with the high bit of every byte a 0), this non-randomness
  484. will propagate throughout the algorithm.
  485.  
  486. In the subkey generation process, the subkeys change slightly
  487. with every pair of subkeys generated.  This is primarily to
  488. protect against any attacked of the subkey generation process
  489. that exploit the fixed and known subkeys.  It also reduces
  490. storage requirements.  The 448 limit on the key size ensures that
  491. the every bit of every subkey depends on every bit of the key. 
  492. (Note that every bit of P15, P16, P17, and P18 does not affect every
  493. bit of the ciphertext, and that any S-box entry only has a .06
  494. probability of affecting any single ciphertext block.)
  495.  
  496. The key bits are repeatedly XORed with the digits of pi in the
  497. initial P-array to prevent the following potential attack: 
  498. Assume that the key bits are not repeated, but instead padded
  499. with zeros to extend it to the length of the P-array.  An
  500. attacker might find two keys that differ only in the 64-bit value
  501. XORed with P1 and P2 that, using the initial known subkeys,
  502. produce the same encrypted value.  If so, he can find two keys
  503. that produce all the same subkeys.  This is a highly tempting
  504. attack for a malicious key generator.
  505.  
  506. To prevent this same type of attack, I fixed the initial
  507. plaintext value in the subkey-generation process.  There is
  508. nothing special about the all-zeros string, but it is important
  509. that this value be fixed.
  510.  
  511. The subkey-generation algorithm does not assume that the key bits
  512. are random.  Even highly correlated key bits, such as an
  513. alphanumeric ASCII string with the bit of every byte set to 0,
  514. will produce random subkeys.  However, to produce subkeys with
  515. the same entropy, a longer alphanumeric key is required.
  516.  
  517. The time-consuming subkey-generation process adds considerable
  518. complexity for a brute-force attack.  The subkeys are too long to
  519. be stored on a massive tape, so they would have to be generated
  520. by a brute-force cracking machine as required.  A total of 522
  521. iterations of the encryption algorithm are required to test a
  522. single key, effectively adding 29 steps to any brute-force
  523. attack.
  524.  
  525. POSSIBLE SIMPLIFICATIONS
  526.  
  527. I am exploring several possible simplifications, aimed at
  528. decreasing memory requirements and execution time.  These are
  529. outlined below:
  530.  
  531.          Fewer and smaller S-boxes.  It may be possible to reduce the
  532.          number of S-boxes from four to one.  Additionally, it may be
  533.          possible to overlap entries in a single S-box: entry 0 would
  534.          consist of bytes 0 through 3, entry 1 would consist of bytes
  535.          1 through 4, etc.  The former simplification would reduce
  536.          the memory requirements for the four S-boxes from 4096 bytes
  537.          to 1024 bytes, the latter would reduce the requirements for
  538.          a single S-box from 1024 bytes to 259 bytes.  Additional
  539.          steps may be required to eliminate the symmetries that these
  540.          simplifications would introduce.  Additionally, four
  541.          different 10- or 12-bit indexes into a single large S-box
  542.          could be used instead of the current series of S-boxes.
  543.  
  544.          Fewer iterations.  It is probably safe to reduce the number
  545.          of iterations from 16 to 8 without compromising security. 
  546.          The number of iterations required for security may be
  547.          dependent on the length of the key.  Note that with the
  548.          current subkey generation procedure, an 8-iteration
  549.          algorithm cannot accept a key longer than 192 bits.
  550.  
  551.          On-the-fly subkey calculation.  The current method of subkey
  552.          calculation requires all subkeys to be calculated advance of
  553.          any data encryption.  In fact, it is impossible to calculate
  554.          the last subkey of the last S-box without calculating every
  555.          subkey that comes before.  An alternate method of subkey
  556.          calculation would be preferable:  one where every subkey can
  557.          be calculated independently of any other.  High-end
  558.          implementations could still precompute the subkeys for
  559.          increased speed, but low-end applications could only compute
  560.          the required subkeys when needed.
  561.  
  562. CONCLUSIONS
  563.  
  564. I conjecture that the most efficient way to break Blowfish is
  565. through exhaustive search of the keyspace.  I encourage all
  566. cryptanalytic attacks, modifications, and improvements to the
  567. algorithm.  Attacks on mini versions of Blowfish, those with a
  568. 32- or even a 16-bit block size, are also encouraged.  Source
  569. code in C and test data can be provided to anyone wishing to
  570. implement the algorithm, in accordance with U.S. export laws.
  571.  
  572. The software magazine Dr. Dobbs Journal is sponsoring $1000
  573. contest for the best cryptanalysis of Blowfish received before
  574. April 1995.  Please contact me for details.
  575.  
  576. Blowfish is unpatented, and will remain so in all countries.  The
  577. algorithm is hereby placed in the public domain, and can be
  578. freely used by anyone.
  579.  
  580. ACKNOWLEDGEMENTS
  581.  
  582. Much of the motivation for this algorithm, as well as the design
  583. criteria, was developed with Niels Fergusen.  I would also like
  584. to thank Eli Biham, Agnes Chan, Peter Gutmann, Angel Johnston,
  585. Lars Kundsen, and Matt Robshaw for their helpful suggestions.
  586.  
  587.  
  588. REFERENCES
  589.  
  590. 1.  E. Biham and A. Shamir, Differential Cryptanalysis of the
  591.          Data Encryption Standard, Springer-Verlag, 1993.
  592.  
  593. 2.  T.W. Cusick and M.C. Wood, "The REDOC-II Cryptosystem,"
  594.          Advances in Cryptology˛CRYPTO '90 Proceedings, Springer-
  595.          Verlag, 1991, pp. 545-563.
  596.  
  597. 3.  J. Deamen, R. Govaerts, and J. Vandewalle, "Block Ciphers
  598.          Based on Modular Arithmetic," Proceedings of the 3rd
  599.          Symposium on State and Progress of Research in Cryptography,
  600.          Rome, Italy, 15-16 Feb 1993, pp. 80-89.
  601.  
  602. 4.  J.-H. Evertse, "Linear Structures in Blockciphers,"  Advances
  603.          in Cryptology˛EUROCRPYT '87, Springer-Verlag, 1988, pp. 249-
  604.          266.
  605.  
  606. 5.  H. Feistel, "Cryptography and Computer Privacy," Scientific
  607.          American, v. 228, n. 5, May 73, pp. 15-23.
  608.  
  609. 6.  GOST 28147-89, "Cryptographic Protection for Data Processing
  610.          Systems,"  "Cryptographic Transformation Algorithm,"
  611.          Government Standard of the U.S.S.R., Inv. No. 3583, UDC
  612.          681.325.6:006.354.  (in Russian)
  613.  
  614. 7.  X. Lai, J. Massey, and S. Murphy, "Markov Ciphers and
  615.          Differential Cryptanalysis," Advances in
  616.          Cryptology˛EUROCRYPT '91 Proceedings, Springer-Verlag, 1991,
  617.          pp. 17-38.
  618.  
  619. 8.  J.L. Massey and X. Lai, "Device for Converting a Digital
  620.          Block and the Use Thereof," International Patent
  621.          PCT/CH91/00117, 16 May 1991.
  622.  
  623. 9.  J.L. Massey and X. Lai, "Device for the Conversion of a
  624.          Digital Block and Use of Same," U.S. Patent 5,214,703, 25
  625.          May 1993.
  626.  
  627. 10.  M. Matsui, "Linear Cryptanalysis Method for DES Cipher,"
  628.          Advances in Cryptology˛CRYPTO '93 Proceedings, Springer-
  629.          Verlag, 1994, in preparation.
  630.  
  631. 11.  R.C. Merkle, "Fast Software Encryption Functions," Advances
  632.          in Cryptology˛CRYPTO '90 Proceedings, Springer-Verlag, 1991,
  633.          pp. 476-501.
  634.  
  635. 12.  R.C. Merkle, "Method and Apparatus for Data Encryption,"
  636.          U.S. Patent 5,003,597, 26 Mar 1991.
  637.  
  638. 13.  S. Miyaguchi, "The FEAL-8 Cryptosystem and Call for Attack,"
  639.          Advances in Cryptology˛CRYPTO '89 Proceedings, Springer-
  640.          Verlag, 1990, pp. 624-627.
  641.  
  642. 14.  S. Miyaguchi, "Expansion of the FEAL Cipher," NTT Review, v.
  643.          2, n. 6, Nov 1990.
  644.  
  645. 15.  S. Miyaguchi, "The FEAL Cipher Family," Advances in
  646.          Cryptology˛CRYPTO '90 Proceedings, Springer-Verlag, 1991,
  647.          pp. 627-638.
  648.  
  649. 16.  National Bureau of Standards, Data Encryption Standard, U.S.
  650.          Department of Commerce, FIPS Publication 46, Jan 1977.
  651.  
  652. 17.  National Institute of Standards and Technology, "Clipper
  653.          Chip Technology," 30 Apr 1993.
  654.   
  655. 18.  RSA Laboratories, Answers to Frequently Asked Questions
  656.          About Today's Cryptography, Revision 2.0, RSA Data Security
  657.          Inc., 5 Oct 1993.
  658.  
  659. 19.  B. Schneier, "Data Guardians," MacWorld, Feb 1993, 145-151.
  660.  
  661. 20.  B. Schneier, Applied Cryptography, John Wiley & Sons, New
  662.          York, 1994.
  663.  
  664. 21.  J.L Smith, The Design of Lucifer, A Cryptographic Device for
  665.          Data Communication, RC 3326, White Plains: IBM Research.
  666.  
  667. 22.  M.J. Weiner, "Efficient DES Key Search," Advances in
  668.          Cryptology˛CRYPTO '93 Proceedings, Springer-Verlag, in
  669.          preparation.
  670.  
  671. 23.  M.C. Wood, "Method of Cryptographically Transforming
  672.          Electronic Digital Data from One Form to Another," U.S.
  673.          Patent 5,003,596, 26 Mar 1991.
  674.  
  675.